home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 24 / CU Amiga Magazine's Super CD-ROM 24 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-07].iso / CUCD / Programming / SWI / source / man / pl.sty < prev    next >
Encoding:
Text File  |  1998-03-24  |  9.9 KB  |  340 lines

  1. %            SWI-Prolog document-style
  2.  
  3. %    Other styles
  4.  
  5. \input logo.sty
  6. \usepackage{a4wide}
  7. \usepackage{fancyheadings}
  8. \usepackage{fancychap}
  9. \usepackage{makeidx}
  10. \usepackage{longtable}
  11. \usepackage{ifthen}
  12. \usepackage{dcolumn}
  13. \usepackage{url}
  14. \usepackage{psfig}
  15. \usepackage{calc}
  16. \setlongtables
  17. \pssilent
  18.  
  19. \catcode`\^^A=8% downarrow are for subscripts
  20. \catcode`\_=\active
  21. \def_{\ifmmode\else\_\fi}
  22. \def\vobeyspaces{\@vobeyspaces}
  23.  
  24. %    FLOATS
  25.  
  26. \setcounter{topnumber}{100}
  27. \renewcommand{\topfraction}{0.9}
  28. \setcounter{totalnumber}{100}
  29. \renewcommand{\bottomfraction}{0.9}
  30. \renewcommand{\textfraction}{0.1}
  31. \renewcommand{\dbltopfraction}{0.9}
  32. \renewcommand{\dblfloatpagefraction}{0.8}
  33. \renewcommand{\floatpagefraction}{0.8}
  34.  
  35. \def\fps@figure{htbp}
  36. \def\fps@table{htbp}
  37.  
  38. %    References
  39.  
  40. \newcommand{\secref}[1]{section~\ref{sec:#1}}
  41. \newcommand{\appref}[1]{appendix~\ref{sec:#1}}
  42. \newcommand{\chapref}[1]{chapter~\ref{sec:#1}}
  43. \newcommand{\figref}[1]{figure~\ref{fig:#1}}
  44. \newcommand{\tabref}[1]{table~\ref{tab:#1}}
  45.  
  46. \newcommand{\Secref}[1]{Section~\ref{sec:#1}}
  47. \newcommand{\Appref}[1]{Appendix~\ref{sec:#1}}
  48. \newcommand{\Chapref}[1]{Chapter~\ref{sec:#1}}
  49. \newcommand{\Figref}[1]{Figure~\ref{fig:#1}}
  50. \newcommand{\Tabref}[1]{Table~\ref{tab:#1}}
  51.  
  52. \newcommand{\tm}{$^{tm}$}
  53.  
  54. \newcommand{\reffont}{\bf}
  55. \newcommand{\predref}[2]{%        % functor/arity
  56.     \mbox{\reffont #1/#2}}
  57. \newcommand{\functor}[2]{%        % functor/arity (no predicate)
  58.     \mbox{\reffont #1/#2}}
  59. \newcommand{\manref}[2]{%        % page(n)
  60.     \mbox{{\reffont #1(}{\rm #2}{\reffont )}}}
  61. \newcommand{\funcref}[2]{%        % function(Args...)
  62.     \mbox{{\reffont #1(}{\it #2}{\reffont )}}}
  63.  
  64. %    Descriptions (definitions) of various things
  65.  
  66. \newcommand{\definition}[1]{%
  67.     \item[\mbox{#1}]\hfill\mbox{}\linebreak}
  68. \newcommand{\defentry}[1]{\definition{#1}}
  69. \newcommand{\emptydefinition}[1]{%
  70.     \makebox[-\leftmargin]{\mbox{}}\mbox{\bf #1}\\}
  71.  
  72. \makeatletter
  73. \def\cmdlineoptionitem{\@ifstar{\@gluedcmdoptitem}{\@cmdoptitem}}
  74. \def\@gluedcmdoptitem#1#2{\definition{#1\var{#2}}}
  75. \def\@cmdoptitem#1#2{\definition{#1 \var{#2}}}
  76. \makeatother
  77.  
  78. \newcommand{\traceoption}[3]{%
  79.     \definition{{\tt #1} (#2)}#3%
  80.     \ignorespaces}
  81. \newcommand{\pleaseoption}[3]{%
  82.     \definition{#1 {\it #2} {\rm(default: \it #3)}}%
  83.     \ignorespaces}
  84. \newcommand{\featureoption}[2]{%
  85.     \definition{#1 ({\it #2})}%
  86.     \ignorespaces}
  87. \newcommand{\escapeitem}[1]{%
  88.     \definition{\Sesc{\tt #1}}
  89.     \ignorespaces}
  90. \newcommand{\fmtchar}[1]{%
  91.     \item[\tt #1]%
  92.     \ignorespaces}
  93. \newcommand{\directive}[3]{%
  94.     \defentry{:- #1({\it #3})}%
  95.     \index{#1/#2}\ignorespaces}
  96. \newcommand{\predicate}[3]{%
  97.     \ifthenelse{\equal{#2}{0}}{%
  98.         \defentry{#1}}{%
  99.         \defentry{#1({\it #3})}}%
  100.     \index{#1/#2}\ignorespaces}
  101. \newcommand{\infixop}[3]{%
  102.     \defentry{{\it #2} #1 {\it #3}}%
  103.     \index{#1/2}\ignorespaces}
  104. \newcommand{\prefixop}[2]{%
  105.     \defentry{#1 {\it #2}}%
  106.     \index{#1/1}\ignorespaces}
  107. \newcommand{\termitem}[2]{%
  108.     \ifthenelse{\equal{}{#2}}{%
  109.         \definition{#1}}{%
  110.         \definition{#1({\it #2})}}\ignorespaces}
  111. \def\term{}
  112. \renewcommand{\term}[2]{%
  113.     \ifthenelse{\equal{}{#2}}{%
  114.         #1}{%
  115.         #1({\it #2})}}
  116. \newcommand{\errorterm}[2]{\mbox{\tt%
  117.     \ifthenelse{\equal{}{#2}}{%
  118.         #1}{%
  119.         #1(#2)}}}
  120. \newcommand{\cfunction}[3]{%
  121.     \defentry{{\it #1} #2({\it #3})}%
  122.     \index{#2()}\ignorespaces}
  123. \newcommand{\cmacro}[3]{%
  124.     \defentry{{\it #1} #2({\it #3})}%
  125.     \index{#2()}\ignorespaces}
  126. \newcommand{\cglobalvar}[1]{{\tt #1}}
  127.  
  128. \renewcommand{\arg}[1]{\ifmmode\mbox{\em #1}\else{\em #1}\fi}
  129. \newcommand{\bnfmeta}[1]{\ifmmode{\langle\mbox{\it #1}\rangle}\else$\langle\mbox{\it #1}\rangle$\fi}
  130. \newcommand{\bnfor}{\ifmmode\mid\else$\mid$\fi}
  131. \newcommand{\isa}{& ::= &}
  132. \newcommand{\ora}{& $\mid$ &}
  133.  
  134. \newcommand{\demo}[1]{{\sf #1}\index{#1 \string\idxtype{demo}}}
  135. \newcommand{\pllib}[1]{library({\tt #1})\index{#1 \string\idxtype{library}}}
  136. \newcommand{\clib}[1]{{\tt #1}\index{#1 \string\idxtype{library}}}
  137. \newcommand{\tool}[1]{{\em #1}\index{#1 \string\idxtype{tool}}}
  138. \newcommand{\constf}[1]{{\tt #1}}
  139. \newcommand{\const}[1]{{\tt #1}}
  140. \newcommand{\type}[1]{{\tt #1}}
  141. \newcommand{\idx}[1]{#1\index{#1}}
  142. \newcommand{\foreseen}[1]{\footnote{#1}}
  143. \newcommand{\email}[1]{\mbox{\tt #1}}
  144. %\newcommand{\url}[1]{\mbox{\tt #1}}
  145. \newcommand{\env}[1]{\mbox{\tt #1}}
  146. \newcommand{\exam}[1]{\mbox{\tt #1}}
  147. \newcommand{\file}[1]{\mbox{\tt #1}}
  148. \newcommand{\fileext}[1]{\mbox{\tt .#1}}
  149. \newcommand{\option}[1]{\mbox{\tt #1}}
  150. \newcommand{\cmdlineoption}[1]{\mbox{\tt #1}}
  151. \newcommand{\argoption}[2]{\mbox{\tt #1 \em #2}}
  152. \newcommand{\ctype}[1]{{\tt #1}}
  153. \newcommand{\op}[1]{{\tt #1}}
  154. \newcommand{\program}[1]{{\tt #1}}
  155. \newcommand{\manpage}[2]{{\bf #1}(#2)}
  156. \newcommand{\chr}[1]{{\tt #1}}
  157. \newcommand{\jargon}[1]{{\em #1}}
  158. \newcommand{\strong}[1]{{\bf #1}}
  159. \newcommand{\texcmd}[1]{{\Sesc}{\tt #1}}
  160. \newcommand{\texenv}[1]{{\tt #1}}
  161. \newcommand{\texmode}[1]{{\tt #1}}
  162. \newcommand{\HTML}[1]{{\bf #1}}
  163.  
  164. \newcommand\satom{\begingroup \urlstyle{tt}\Url}
  165. \newcommand\fmtseq{\begingroup \urlstyle{tt}\Url}
  166. %\newcommand\file{\begingroup \urlstyle{tt}\Url}
  167.  
  168. \urldef{\Sexe}\satom{#!}        % #!
  169. \urldef{\Scut}\satom{!}            % !
  170. \urldef{\Scomma}\satom{,}        % ,
  171. \urldef{\Sifthen}\satom{->}        % ->
  172. \urldef{\Ssoftcut}\satom{*->}         % *->
  173. \urldef{\Sdot}\satom{.}         % .
  174. \urldef{\Ssemicolon}\satom{;}         % ;
  175. \urldef{\Slt}\satom{<}             % <
  176. \urldef{\Seq}\satom{=}             % =
  177. \urldef{\Suniv}\satom{=..}         % =..
  178. \urldef{\Saeq}\satom{=:=}         % =:=
  179. \urldef{\Sle}\satom{=<}         % =<
  180. \urldef{\Sequal}\satom{==}         % ==
  181. \urldef{\Sstructeq}\satom{=@=}         % =@=
  182. \urldef{\Sstructneq}\satom{\=@=}     % \=@=
  183. \urldef{\Sane}\satom{=\=}         % =\=
  184. \urldef{\Sgt}\satom{>}             % >
  185. \urldef{\Sge}\satom{>=}         % >=
  186. \urldef{\Stlt}\satom{@<}         % @<
  187. \urldef{\Stle}\satom{@=<}         % @=<
  188. \urldef{\Stgt}\satom{@>}         % @>
  189. \urldef{\Stge}\satom{@>=}         % @>=
  190. \urldef{\Snot}\satom{\+}         % \+
  191. \urldef{\Sne}\satom{\=}         % \=
  192. \urldef{\Snequal}\satom{\==}         % \==
  193. \urldef{\Shat}\satom{^}         % ^
  194. \urldef{\Sbar}\satom{|}         % |
  195. \urldef{\Stimes}\satom{*}        % *
  196. \urldef{\Spow}\satom{**}        % **
  197. \urldef{\Splus}\satom{+}        % +
  198. \urldef{\Sminus}\satom{-}        % -
  199. \urldef{\Sdiv}\satom{/}            % /
  200. \urldef{\Sidiv}\satom{//}        % //
  201. \urldef{\Sand}\satom{/\}        % /\
  202. \urldef{\Slshift}\satom{<<}        % <<
  203. \urldef{\Srshift}\satom{>>}        % >>
  204. \urldef{\Sneg}\satom{\}            % \
  205. \urldef{\Sesc}\satom{\}            % \
  206. \urldef{\Sor}\satom{\/}            % \/
  207. \urldef{\Sdollar}\satom{$}        % $
  208. \urldef{\Squest}\satom{?}        % ?
  209. \urldef{\Smodule}\satom{:}        % :
  210. \urldef{\Sneck}\satom{:-}        % :-
  211. \urldef{\Sdirective}\satom{?-}        % ?-
  212. \urldef{\Sdcg}\satom{-->}        % -->
  213. \urldef{\Bc}\satom{\c}            % \c
  214. \urldef{\Bn}\satom{\n}            % \n
  215. \urldef{\Br}\satom{\r}            % \r
  216. \urldef{\Bl}\satom{\l}            % \l
  217. \urldef{\BB}\satom{\\}            % \\
  218. \urldef{\Stilde}\satom{~}        % ~
  219. \urldef{\Spercent}\satom{%}        % %
  220. \urldef{\Shash}\satom{#}        % #
  221.  
  222. \newcommand{\bug}[1]{\footnote{BUG: #1}}
  223.  
  224. \newcommand{\mod}[2]{#1 \mbox{\rm mod} #2}
  225. \newcommand{\rem}[2]{#1 \mbox{\rm rem} #2}
  226. \newcommand{\pow}[2]{{#1}^{#2}}
  227.  
  228. %    Index handling
  229.  
  230. \newcommand{\idxtype}[1]{{\small\em #1}}
  231.  
  232. %    Prolog predicate summary
  233.  
  234. \newenvironment{summarylist}[1]{\begin{longtable}[l]{#1}}{\end{longtable}}
  235. \newcommand{\predicatesummary}[3]{#1/#2 & #3 \\}
  236. \newcommand{\oppredsummary}[5]{#1/#2 & #5 \\}
  237. \newcommand{\functionsummary}[3]{#1/#2 & #3 \\}
  238. \newcommand{\opfuncsummary}[5]{#1/#2 & #5 \\}
  239. \newcommand{\opsummary}[4]{#3 & #1 & #2 & #4 \\}
  240. \newcommand{\hook}[1]{(hook)}
  241.  
  242.  
  243. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  244. %            CODE environment            %
  245. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  246.  
  247. \newlength{\codeindent}
  248. \setlength{\codeindent}{\leftmargin}
  249. \newenvironment{codequote}%
  250.     {\begin{list}{}{\setlength{\leftmargin}{0pt}%
  251.             \setlength{\rightmargin}{0pt}}%
  252.             \item[]\small\ignorespaces}%
  253.       {\end{list}}
  254.  
  255.  
  256. %    just like verbatim, but indents like quote.
  257. %    allows also the use of leading tabs
  258.  
  259. \makeatletter
  260. {\catcode`\^^I=\active
  261.     \gdef^^I{\mbox{}\space\space\space\space\space\space\space\space}}
  262.  
  263. \begingroup \catcode `|=0 \catcode `[= 1
  264. \catcode`]=2 \catcode `\{=12 \catcode `\}=12
  265. \catcode`\\=12
  266. |gdef|@xcode#1\end{code}[#1|end[code]]
  267. |endgroup
  268.  
  269. \def\@code{\trivlist\setlength{\leftmargin}{\codeindent}%
  270.             \setlength{\rightmargin}{\codeindent}%
  271.             \item[]\if@minipage\else\vskip\parskip\fi
  272. \leftskip\@totalleftmargin\rightskip\z@
  273. \parindent\z@\parfillskip\@flushglue\parskip\z@
  274. \@tempswafalse \def\par{\if@tempswa\hbox{}\fi\@tempswatrue\@@par}
  275. \obeylines \catcode`\^^I=\active \tt \let\do\@makeother \dospecials}
  276.  
  277. \def\code{\@code \frenchspacing\@vobeyspaces \@xcode}
  278. \def\@endcode{\endtrivlist}
  279. \let\endcode=\@endcode
  280.  
  281.  
  282. %    PostScript figures
  283. %    \postscriptfig[width=5in]{label}{Title}
  284.  
  285. \def\postscriptfig{\@ifnextchar[{\@scaledpostscriptfig}{\@postscriptfig}}
  286. \def\@scaledpostscriptfig[#1]#2#3{%
  287.     \begin{figure}%
  288.         \centerline{\psfig{figure=figs/#2.eps,#1}}
  289.         \caption{#3}
  290.         \label{fig:#2}
  291.     \end{figure}}
  292. \def\@postscriptfig#1#2{%
  293.     \begin{figure}%
  294.         \centerline{\psfig{figure=figs/#1.eps}}
  295.         \caption{#2}
  296.         \label{fig:#1}
  297.     \end{figure}}
  298. \makeatletter
  299.  
  300.  
  301. %    \begin{tabularlp}{longest-text}
  302.  
  303. \newlength{\tabDright}
  304. \newlength{\tabDleft}
  305. \newcommand{\PreserveBackslash}[1]{\let\temp=\\#1\let\\=\temp}
  306. \newcommand{\raggedrightcolumn}{\PreserveBackslash\raggedright\hspace{0pt}}
  307. \newenvironment{tabularlp}[1]%
  308.     {\settowidth{\tabDleft}{#1}%
  309.      \setlength{\tabDright}{\linewidth-\columnsep*3-\tabDleft}%
  310.      \begin{tabular}{|p{\tabDleft}|>{\raggedrightcolumn}p{\tabDright}|}}%
  311.     {\end{tabular}}
  312.  
  313. %    PAGESTYLE
  314. %
  315. %       Chapter                            date
  316. %       ---------------------------------------
  317. %
  318. %    bla, bla, bla, ...
  319. %    
  320. %       \bottomleft    - page -    \bottomright
  321.  
  322. \def\arabicday{\number\year-\number\month-\number\day}
  323.  
  324. \providecommand{\runningtitle}{none}
  325.  
  326. \ifthenelse{\equal{\runningtitle}{none}}{%
  327.     \relax}{%
  328. \pagestyle{fancyplain}
  329. \headheight 14pt
  330. \def\chaptermark{\mbox{}}
  331. \renewcommand{\chaptermark}[1]{\markboth{#1}{#1}} % remember chapter title
  332. \renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
  333.  
  334. \lhead[\fancyplain{}{\bf\thepage}]{\fancyplain{}{\bf\rightmark}}
  335. \rhead[\fancyplain{}{\bf\leftmark}]{\fancyplain{}{\bf\thepage}}
  336. \footrulewidth 0.2pt
  337. \lfoot[\tiny \runningtitle]{}
  338. \rfoot[]{\tiny \runningtitle}
  339. \cfoot{}}
  340.